Setting culling

In Kanzi render passes you can optimize the performance of meshes in your applications by setting the culling properties.

Setting the cull mode

By default Kanzi culls in 3D content the polygons whose normal points away from the active camera. To override this, you can set the cull mode in a Pipeline State Render Pass.

To set the cull mode:

  1. In the Library > Rendering > Render Passes press Alt and right-click and select Pipeline State Render Pass, or select an existing Pipeline State Render Pass. See Render passes.
  2. In the Properties set the Cull Mode property to:
  3. In the Pipeline State Render Pass create a Clear Render Pass and the Draw Objects Render Pass that you use to draw the nodes you want to cull.
    You can use filters to collect specific nodes for rendering. See Filters.
  4. Take into use the render passes you created:
    1. In the Project select the Scene or Viewport 2D node which contains the content you want to render.
    2. In the Properties set the Render Pass property to the topmost render pass in the render pass tree which contains the Pipeline State Render Pass you created.

Controlling culling

You can control culling for individual meshes. For example, this is useful when a vertex shader radically modifies the geometry of nodes, such as in vertex skinned nodes.

To control culling:

  1. Render the meshes for which you want to control culling with a Legacy Render Pass (deprecated) render pass. Make sure that the Frustum Culling property is enabled in the Legacy Render Pass (deprecated).
  2. In the Project select the node for which you want to control culling.
  3. In the Properties click , and add the Frustum Cull Margin property.
  4. Adjust the cull margin of the node.
    To see if your culling setting works as you intended it to work, in the Preview click to enter the Analyze mode, right-click , select the Performance HUD, and move the camera away from the node for which you want to control culling. When culling does not occur anymore for the node, Batch count value drops.

See also

Rendering

Filters

Reducing the number of rendered vertices

Setting the correct size of vertex cache

Loading resources in parallel

Troubleshooting the performance of your application

Best practices